﻿namespace EveKillboard.Data
{
    using System;

    public static class Extensions
    {
        /// <summary>
        /// Throws an ObjectDisposedException if the instance is already disposed
        /// </summary>
        /// <param name="instance"></param>
        public static void ThrowIfDisposed(this Core.Interfaces.IDisposed instance)
        {
            if (instance.IsDisposed)
                throw new ObjectDisposedException(string.Format("The instance of type \"{0}\" is disposed.", instance.GetType()));
        }


    }
}